package xyz.zhouzhaodong.crm.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import xyz.zhouzhaodong.crm.dto.CustomerDto;
import xyz.zhouzhaodong.crm.dto.FormDto;
import xyz.zhouzhaodong.crm.entity.Customer;
import xyz.zhouzhaodong.crm.service.ICustomerService;
import xyz.zhouzhaodong.crm.util.NoRepeatSubmit;
import xyz.zhouzhaodong.crm.util.RestMessage;

import javax.annotation.Resource;

/**
 * <p>
 * 客户表 前端控制器
 * </p>
 *
 * @author zhouzhaodong
 * @since 2020-06-17
 */
@RestController
@RequestMapping("/customer")
public class CustomerController {

    @Resource
    ICustomerService customerService;

    /**
     * 新增
     * @param customer
     * @return
     */
    @NoRepeatSubmit
    @RequestMapping("/add")
    public RestMessage addCustomer(Customer customer){
        return customerService.addCustomer(customer);
    }

    /**
     * 删除
     * @param customer
     * @return
     */
    @RequestMapping("/delete")
    public RestMessage deleteCustomer(Customer customer){
        return customerService.deleteCustomer(customer);
    }

    /**
     * 永久删除
     * @param customer
     * @return
     */
    @RequestMapping("/thoroughDelete")
    public RestMessage thoroughDelete(Customer customer){
        return customerService.thoroughDelete(customer);
    }

    /**
     * 修改
     * @param customer
     * @return
     */
    @RequestMapping("/update")
    public RestMessage updateCustomer(Customer customer){
        return customerService.updateCustomer(customer);
    }

    /**
     * 修改用户id
     * @param customer
     * @return
     */
    @RequestMapping("/updateStaffId")
    public RestMessage updateStaffId(Customer customer){
        return customerService.updateStaffId(customer);
    }

    /**
     * 根据id查询相关信息
     * @param id
     * @return
     */
    @RequestMapping("/selectById")
    public RestMessage selectById(String id){
        return customerService.selectById(id);
    }

    /**
     * 根据编号查询
     * @param number
     * @return
     */
    @RequestMapping("/selectByNumber")
    public RestMessage selectByNumber(String number){
        return customerService.selectByNumber(number);
    }

    /**
     * 查询
     * @param customerDto
     * @return
     */
    @RequestMapping("/select")
    public RestMessage selectCustomer(CustomerDto customerDto){
        return customerService.selectCustomer(customerDto);
    }

    /**
     * 待沟通列表查询
     * @param customerDto
     * @return
     */
    @RequestMapping("/selectLinkUp")
    public RestMessage selectLinkUp(CustomerDto customerDto) {
        return customerService.selectLinkUp(customerDto);
    }

    /**
     * 查询数目
     * @param customerDto
     * @return
     */
    @RequestMapping("/selectNum")
    public RestMessage selectNum(CustomerDto customerDto){
        return customerService.selectNum(customerDto);
    }

    /**
     * 修改客户状态
     * @param customer
     * @return
     */
    @RequestMapping("/changeType")
    public RestMessage changeType(Customer customer){
        return customerService.changeType(customer);
    }

    /**
     * 成交列表显示
     * @param customerDto
     * @return
     */
    @RequestMapping("/selectCustomerDeal")
    public RestMessage selectCustomerDeal(CustomerDto customerDto){
        return customerService.selectCustomerDeal(customerDto);
    }

    /**
     * 完成录取列表
     * @param customerDto
     * @return
     */
    @RequestMapping("/selectCustomerComplete")
    public RestMessage selectCustomerComplete(CustomerDto customerDto){
        return customerService.selectCustomerComplete(customerDto);
    }

    /**
     * 待报到列表显示
     * @param customerDto
     * @return
     */
    @RequestMapping("/selectCustomerReport")
    public RestMessage selectCustomerReport(CustomerDto customerDto){
        return customerService.selectCustomerReport(customerDto);
    }

    /**
     * 到校列表显示
     * @param customerDto
     * @return
     */
    @RequestMapping("/selectCustomerToSchool")
    public RestMessage selectCustomerToSchool(CustomerDto customerDto){
        return customerService.selectCustomerToSchool(customerDto);
    }

    /**
     * 汇总显示
     * @param formDto
     * @return
     */
    @RequestMapping("/selectCustomerForm")
    public RestMessage selectCustomerForm(FormDto formDto){
        return customerService.selectCustomerForm(formDto);
    }

}
